package graphique;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

import composantes.PlaqueCellulaire;

import fenetre.TabJeu;
import fenetre.FenetreConsole;

public class JeuCellule {
	@SuppressWarnings("unused")
	public static void main(String[] args) throws Exception{
		PlaqueCellulaire grille = new PlaqueCellulaire(10, 10);
		grille.setCellule(5, 5, 2, 0);
		grille.setCellule(5, 4, 1, 0);
		grille.setCellule(4, 5, 1, 0);
		grille.setCellule(5, 6, 2, 0);
		grille.setCellule(6, 5, 2, 0);
		
		if(true){
		
			//==================Graphique====================
			TabJeu f = new TabJeu(grille);
		
		}
		else{
			//==================Console======================
			FenetreConsole f = new FenetreConsole(grille);
			Scanner b = new Scanner(System.in);
			int x = 0, y = 0;
			
			while(true){
				f.afficher();
				System.out.println("src (x y):");
				x = b.nextInt();
				y = b.nextInt();
				f.selectCase(x, y);
				
				System.out.println("dst (x y):");
				x = b.nextInt();
				y = b.nextInt();
				f.selectCase(x, y);
				if(!f.update())
					System.out.println("Can't update");
			}
		}
	}
}
